# Title     : TODO
# Objective : TODO
# Created by: Administrator
# Created on: 2019/6/18

# library(MetaboAnalystR)
library(plyr)
library(ggplot2)
library(dplyr)
library(tidyr)
library(tibble)
library(gridExtra)
library(ggpubr)
library(egg)
library(lemon)
library(purrr)
library(ComplexHeatmap)
library(Hmisc)

options(digits = 3)

data <- read.table("pathway_input.txt", header = T, sep = "\t", stringsAsFactors = F) %>%
filter(p < 0.05)

windowsFonts(Times = windowsFont("Times New Roman"))

plotData<-data

head(plotData)

p <- ggplot(plotData, mapping = aes(x = p, y = Name)) +
    ylab("") +
    xlab("Importance") +
    theme_bw(base_size = 8.8, base_family = "Times") +
    theme(axis.text.x = element_text(size = 10, hjust = 1, vjust = 1), legend.position = 'top',
    legend.text = element_text(size = 9), legend.title = element_text(size = 11), axis.text.y = element_text(size = 10),
    axis.title.y = element_text(size = 11), axis.title.x = element_text(size = 12), panel.grid.major.x = element_blank(),
    panel.border = element_rect(size = 0.75), panel.grid.minor.x = element_blank(), panel.grid.major.y = element_line(
    linetype = 2, color = "#BEBEBE")
    ) +
    geom_point(fill = "blue", shape = 21, color = "blue", size = 3)

ggsave(limitsize = FALSE,'tmp.pdf', p, width = 6, height = 8)